package city.spring.modules.medicine.vo;

import city.spring.action.model.AbstractMedicineinventoryUser;
import city.spring.modules.medicine.entity.MedicineinventoryEmployeeExtEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * @author 谢金婷
 * @date 2020/7/27 0004 16:48
 * @see MedicineinventoryEmployeeExtEntity
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class MedicineinventoryUserVO extends MedicineinventoryEmployeeExtEntity {
    /**
     * 人员名称
     */
    private String name;

    /**
     * 部门
     */
    private String orgName;

    /**
     * 职务
     */
    private String job;

    /**
     * 手机号
     */
    private String telPhone;


    /**
     * 转换成排班时所需要的对象
     *
     * @return AbstractPlanUser
     */
    public AbstractMedicineinventoryUser<MedicineinventoryUserVO> toInventoryUser() {
        MedicineinventoryUserVO item = this;
        return new AbstractMedicineinventoryUser<MedicineinventoryUserVO>() {

            @Override
            public Object getKey() {
                return item.getUserId();
            }

            @Override
            public String getName() {
                return item.getName();
            }

            @Override
            public String getOrgName() {
                return item.getOrgName();
            }

            @Override
            public String getJob() {
                return item.getJob();
            }

            @Override
            public String getTelPhone() {
                return item.getTelPhone();
            }

            @Override
            public MedicineinventoryUserVO getObject() {
                return item;
            }
        };
    }
}
